package com.ruoyi.pcj.domain;

import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField;
import com.mashuai.utils.toolkit.core.msHandlebean.annotation.MsJoinSubTable;
import com.mashuai.utils.toolkit.core.msHandlebean.annotation.MsJoinTable;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.pcj.constant.TbConstant;
import lombok.Data;
import lombok.Getter;

/**
 * 贴吧-文章对象 pcj_tb_article
 *
 * @author dk
 * @date 2024-02-28
 */
@Data
@TableName(TbConstant.pcjTbArticle)
public class PcjTbArticle extends BaseEntity {
    private static final long serialVersionUID = 1L;


    /**
     * $column.columnComment
     */
    @TableId
    @TableField("id")
    private String id;


    /**
     * 删除标志（0代表存在 1代表删除）
     */
    @TableLogic
    @TableField("del_flag")
    private Integer delFlag;


    /**
     * 文章作者id
     */
    @MsJoinTable(joinTable = TbConstant.sysUser, joinField = "user_id", needFields = {"nick_name@userName"})
    @TableField("user_id")
    private Long userId;

    /**
     * 文章作者名称
     */
    @TableField(exist = false)
    private String userName;


    /**
     * 发布时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @TableField("publish_time")
    private Date publishTime;


    /**
     * 文章状态，0-编辑，1审核中，2通过，3不通过，4下架
     */
    @TableField("status")
    private String status;


    /**
     * 一级板块id
     */
    @MsJoinTable(joinTable = TbConstant.pcjPlate, needFields = {"name@plateName"})
    @TableField("plate_id")
    private String plateId;
    /**
     * 一级板块名称
     */
    @TableField(exist = false)
    private String plateName;

    /**
     * 二级板块分区id
     */
    @MsJoinTable(joinTable = TbConstant.pcjPlatePat, needFields = {"name@partitionName"})
    @TableField("partition_id")
    private String partitionId;
    /**
     * 二级板块分区名称
     */
    @TableField(exist = false)
    private String partitionName;


    /**
     * 发布地址
     */
    @TableField("address")
    private String address;


    /**
     * 文章标题
     */
    @TableField("title")
    private String title;


    /**
     * 内容-包含富文本
     */
    @TableField("content")
    private String content;


    /**
     * 记录上传的图片的url，方便首页展示缩略图
     */
    @TableField("upload_img_url")
    private String uploadImgUrl;


    /**
     * 被收藏数量
     */
    @TableField("collect_num")
    private Integer collectNum;

    @TableField(exist = false)
    private Boolean  collectFlag;

    /**
     * 被点赞数量
     */
    @TableField("like_num")
    private Integer likeNum;

    @TableField(exist = false)
    private Boolean likeFlag;

    /**
     * 被评论数量
     */
    @TableField("comment_num")
    private Integer commentNum;


    /**
     * 不通过原因
     */
    @TableField("reject_reason")
    private String rejectReason;


    /**
     * 下架原因
     */
    @TableField("pulled_reason")
    private String pulledReason;

    /**
     * 文章图片url
     */
    @TableField(exist = false)
    private List<String> fileUrls;

    /**
     * 一级评论
     */
    @TableField(exist = false)
    private List<PcjTbComment> pcjTbCommentList;

    /**
     * 话题
     */
    @TableField(exist = false)
    private List<String> subjects;


}
